﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.Windows.Forms;

namespace shp2postgres
{
    public partial class About : Form
    {
        private int t = 2;
        private System.Timers.Timer tmrAbout = new System.Timers.Timer();
        
        public About()
        {
            InitializeComponent();
            tmrAbout.Enabled = true;
            tmrAbout.Interval = 1000;
        }

        private void Btn_About_Click(object sender, EventArgs e)
        {
            this.Dispose();
            this.Close();
        }


        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Clipboard.SetText(linkLabel1.Text);
            label3.Visible = true;
            tmrAbout.Start();
            tmrAbout.Elapsed += TmrAbout_Elapsed;
        }

        private void TmrAbout_Elapsed(object sender, ElapsedEventArgs e)
        {
            if (t == 0)
            {
                tmrAbout.Stop();
                tmrAbout.Dispose();
                this.Close();
                return;
            }
            label3.Text = $"链接已复制到粘贴板，{t--} 秒后自动关闭！";
        }
    }
}
